#include "mainwindow.h"
#include "ui_mainwindow.h"


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    _yuvPlayer = new YUVPlayer(this);

    int width = 600;
    int height = 400;

    int x = (this->width() - width) >> 1;
    int y = (this->height() - height) >> 1;

    _yuvPlayer->setGeometry(x,y,width,height);

    YUVSpec yuvSpec;
    yuvSpec.filePath = "/Users/tgy/Documents/ffmpeg/video/demo02.yuv";
    yuvSpec.format = AV_PIX_FMT_YUV420P;
    yuvSpec.fps = 27;
    yuvSpec.width = 544;
    yuvSpec.height = 960;

    _yuvPlayer->init(yuvSpec);

    _yuvPlayer->start();
}

MainWindow::~MainWindow()
{
    delete ui;
}

